import { Modal } from 'antd'
import { lazy } from 'react'
import { Suspense } from '@/desktop/components/Loading'
const CodeList = lazy(async () => import('./code-list'))

export { ReactComponent as Icon } from './icon.svg'

export function CodeJoinGroups({ open, onClose }: { open: boolean; onClose: () => void }) {
  return <Modal
    title="口令进群"
    footer={null}
    width="800px"
    open={open}
    onCancel={onClose}
    maskClosable
    destroyOnClose
  >
    {open ? (
      <Suspense>
        <CodeList />
      </Suspense>
    ) : null}
  </Modal>
}
